{% extends 'base.html' %}
{% load static %}
{% block title %} article post {% endblock %}

{% block content %}
    <div style="margin-left:10px;font-size:medium">
        <form class="form-horizontal" action="" method="post">{% csrf_token %}
          <div class="row" style="margin:10px">
              <div class="col-md-2 text-right"><span style="font-weight: bold">标题：</span></div>
              <div class="col-md-10 text-left">
                  <input type="text" id="a_title" placeholder="输入文章标题" style="height: 28px;font-size: 15px;width: 280px">
              </div>
          </div>
          <div class="row" style="margin:10px">
              <div class="col-md-2 text-right"><span style="font-weight: bold">栏目：</span></div>
              <div class="col-md-10 text-left">
                <select id="which_column" style="font-weight: 600">
                    {% for column in columns %}
                        <option value="{{column.id}}">{{column.c_name}}</option>
                    {% endfor %}
                </select>
              </div>
          </div>
          <div class="row" style="margin:10px">
            <div class="col-md-2 text-right" style="margin-bottom: 20px"><span style="font-weight: bold">内容：</span></div>
                <div id="editormd" class="col-md-10 text-left">
                    <label for="id_body"></label>
                    <textarea style="height: 200px;width: 300px" id="id_body"></textarea>
                </div>
            </div>
          <div class="row">
             <input type="button" class="btn btn-primary btn-lg" value="发布" onclick="publish_article()">
          </div>
        </form>
    </div>
{% endblock %}
{% block jsFiles %}
    <script type="text/javascript" src='{% static "editor/editormd.min.js" %}'></script>
    <script type="text/javascript" src="{% static 'js/article/article_post_manage.js' %}"></script>
    <script>
        $(function() {
          var editor = editormd("editormd", {
              width  : "100%",
              height  : 640,
              syncScrolling : "single",
              path:"{% static 'editor/lib/' %}"
          });
        });
    </script>
{% endblock %}
